{extend name="public/base" /}

{block name="title"}
<title>{if condition="isset($info)"}编辑{else /}新增{/if}</title>
{/block}

{block name="pjax_container"}
<style>
    tr>th,
    td {
        text-align: center;
    }



    .content-header>.breadcrumb>li {
        color: #999;
    }

    .content-header>.breadcrumb>.active {
        color: #666;
    }

    .content-header {
        height: 51px;

    }

    .btn-primary {
        background-color: #1890FF;
        color: #fff;
        border: none;
        border-radius: 6px !important;
        margin-left: 15px;
        padding: 5px 10px;
    }

    .box-primary {
        border-top-color: #ecf0f5 !important;
        border-top-width: 16px;

    }

    .btn-primary:hover {
        background-color: #1890FF;
        color: #fff;
        border: none;
        opacity: .9;
        border-radius: 6px !important;
    }

    .delete-one {
        background-color: ff4141 !important;
        margin-left: 15px;
        border-radius: 6px;
    }

    .sreachs {
        background-color: #1890FF;
        color: #fff;
        border: none;
        border-radius: 6px !important;
        margin-left: 15px;
        padding: 7px 15px;
    }

    .input-group {
        display: flex;
        flex-wrap: wrap;
    }

    .sreachs:hover {
        background-color: #1890FF;
        color: #fff;
        border: none;
        opacity: .8;
        border-radius: 6px !important;
        margin-left: 15px;
        padding: 7px 15px;
    }

    .form-group>label {
        height: 100%;
        line-height: 30px;
        margin-left: 10px;
    }

    .form-group>input {
        border: none;
        height: 100%;
        border-bottom: 1px solid #ccc;
    }

    .nav-tabs-custom {
        margin-top: 16px;
    }
</style>
<section class="content-header">
    <ol class="breadcrumb">
        <li>系统管理</li>
        <li>权限管理</li>
        <li class="active">权限信息</li>
    </ol>
</section>
<section class="content">
    <div class="row">
        <div class="col-md-12">
            <form class="form-horizontal" method="POST" action="/{$Think.MODULE_NAME}/{$Think.CONTROLLER_NAME}/{$Think.ACTION_NAME}" onsubmit="return false" >
                <div class="nav-tabs-custom">
                    <ul class="nav nav-tabs">
                        <li class="active"><a href="#tab1" data-toggle="tab">基本参数</a></li>
                        <li class="pull-right"><a href="javascript:history.back(-1)" class="btn btn-sm" style="padding:10px 2px;"><i class="fa fa-list"></i> 返回</a></li>
                    </ul>
                    <div class="tab-content">
                        <div class="tab-pane active" id="tab1">
                            <input type="hidden" name="id" value="{$info['id']|default=0}" />
                            <div class="form-group">
                                <label class="col-sm-2 control-label">上级节点</label>
                                <div class="col-sm-7">
                                    <select class="form-control select2" name="pid" style="width:100%;">
                                        <option value="0">顶级节点</option>
                                        <?php $params=[
                                            "type" => "option",
                                            "pid"  => isset($info["pid"])?$info["pid"]:0,
                                        ]; ?>
                                        {volist name="permissionList" id="v"}
                                            {:getPermissionHtml($v,0,$params)}
                                            {notEmpty name="v['list']"}
                                                {volist name="v['list']" id="vOne"}
                                                    {:getPermissionHtml($vOne,1,$params)}
                                                    {notEmpty name="vOne['list']"}
                                                        {volist name="vOne['list']" id="vTwo"}
                                                            {:getPermissionHtml($vTwo,2,$params)}
                                                        {/volist}
                                                    {/notEmpty}
                                                {/volist}
                                            {/notEmpty}
                                        {/volist}
                                    </select>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">名称</label>
                                <div class="col-sm-7"><input class="form-control" name="title" value="{$info['title']|default=''}" placeholder="名称"></div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">地址</label>
                                <div class="col-sm-7"><input class="form-control" name="url" value="{$info['url']|default=''}" placeholder="功能地址，例如：Index/index" autocomplete="off"></div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">导航显示</label>
                                <div class="col-sm-7">
                                    <select class="form-control select2" name="status" style="width:100%;">
                                        <option value="1" {if condition="isset($info['status']) && $info['status']==1"}selected="selected"{/if} >是</option>
                                    <option value="0" {if condition="isset($info['status']) && $info['status']==0"}selected="selected"{/if} >否</option>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">图标</label>
                                <div class="col-sm-7"><input class="form-control" name="icon" value="{$info['icon']|default=''}" placeholder="图标来源http://fontawesome.dashgame.com/，格式：fa fa-xx"></div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">排序值</label>
                                <div class="col-sm-7">
                                    <input class="form-control" name="sort" value="{$info.sort|default=''}" placeholder="数字，越大越在前面">
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="box-footer">
                        <div class="col-sm-2"></div>
                        <div class="col-sm-7">
                            <div class="btn-group pull-right">
                                <button type="submit" class="btn btn-info pull-right submits" data-loading-text="&lt;i class='fa fa-spinner fa-spin '&gt;&lt;/i&gt; 提交">提交</button>
                            </div>
                        </div>
                    </div>
                </div>
            </form>
        </div>
    </div>
</section>
<script type="application/javascript">
$(function() {
    $(".select2").select2({language: "zh-CN"});
});
</script>
{/block}